package com.lyf.learn.atsgg.spring.aop;

import com.lyf.learn.atsgg.spring.aop.config.GlobalConfig;
import com.lyf.learn.atsgg.spring.aop.controller.TestController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/7
 * @VERSION 1.0
 * @DESC
 */
public class MainApp {
    public static void main(String[] args) {
//        TestController testController = new TestController();
//        testController.test1();
        ApplicationContext
                applicationContext = new AnnotationConfigApplicationContext(GlobalConfig.class);
//        String[] beans = applicationContext.getBeanDefinitionNames();
//        System.out.println(Arrays.toString(beans));
        TestController t =(TestController) applicationContext.getBean("testController");
        t.test1();
        t.test2("hello,aop!");
    }
}
